package designs.models.memento.example.one;

import java.util.Stack;

public class Caretaker {
	Stack<UnicodeLabel.Memento> stack;
	public Caretaker() {
		stack = new Stack<>();
	}
	public UnicodeLabel.Memento getMemento(){
		if (!(stack.isEmpty())) {
			UnicodeLabel.Memento pop = stack.pop();
			return pop;
		}else {
			return null;
		}
	}
	
	public void saveMemento(UnicodeLabel.Memento memento) {
		stack.push(memento);
	}
}
